<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>学校同位分管理</title>
	<meta name="decorator" content="default"/>
</head>
<body>
<div class="main-content">
    <tags:breadcrumb menuId="d13a995abb1f4a09bea8de9f03276f37" />
    <div class="page-content">
        <form class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-2 no-padding-right control-label">年份：</label>
            <div class="col-sm-10">
                <select id="year" class="col-sm-6 required chosen-select">
                    <option value="">--请选择年份--</option>
                    <c:forEach items="${fns:getDictList('close_year')}" var="item">
                        <option value="${item.value}">${item.label}</option>
                    </c:forEach>
                </select>
                <span class="important">*</span>
            </div>
        </div><hr>
        <div class="form-actions">
            <input id="btnSubmit" class="btn btn-primary" type="button" value="初始化同位分数据"/>
            <input id="btnLqRate" class="btn btn-info" type="button" value="初始化录取概率数据"/>
        </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#name").focus();
        $("#btnSubmit").click(function(){
            var year = $("#year").val();
            if(year!=""){
                var url = "${ctx}/score/schoolTwfInfo/save";
                $.post(url,{year:year},function(data){
                    if(data.success){
                        showNote("success",function(){
                            window.location.href = "${ctx}/score/schoolTwfInfo/list";
                        },data.msg,"center");
                    }else{
                        showNote("error",function(){return false;},data.msg,"center");
                    }
                });
            }else{
                showNote("error",function(){return false;},"输入有误，请选择年份","center");
            }
        });

        //初始化录取概率
        $("#btnLqRate").click(function(){
            var year = $("#year").val();
            if(year!=""){
                var url = "${ctx}/score/schoolLqRate/save";
                $.post(url,{year:year},function(data){
                    if(data.success){
                        showNote("success",function(){
                            window.location.href = "${ctx}/score/schoolLqRate/list";
                        },data.msg,"center");
                    }else{
                        showNote("error",function(){return false;},data.msg,"center");
                    }
                });
            }else{
                showNote("error",function(){return false;},"输入有误，请选择年份","center");
            }
        });
    });
</script>
</body>
</html>